package com.winenine999.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.winenine999.custom.dao.CSyuserroleMapper;
import com.winenine999.generator.dao.SyuserroleMapper;
import com.winenine999.model.Syuserrole;
import com.winenine999.service.ISyuserroleService;
@Service
public class SyuserroleService implements ISyuserroleService {
	@Autowired
	private SyuserroleMapper syuserroleMapper;
	@Autowired
	private CSyuserroleMapper cSyuserroleMapper;
	/**
	 * 根据id删除syuserrole
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
		
		return syuserroleMapper.deleteByPrimaryKey(id);
	}
	/**
	 * 选择字段插入syuserrole
	 */
	@Override
	public int insertSelective(Syuserrole syuserrole) {
		
		return syuserroleMapper.insertSelective(syuserrole);
	}
	
	/**
	 * 根据id查询syuserrole
	 */
	@Override
	public Syuserrole selectByPrimaryKey(Integer id) {
		
		return syuserroleMapper.selectByPrimaryKey(id);
	}
	/**
	 * 选择字段修改
	 */
	@Override
	public int updateByPrimaryKeySelective(Syuserrole syuserrole) {
		
		return syuserroleMapper.updateByPrimaryKeySelective(syuserrole);
	}
//---------------------------custom-------------------------------------
	/**
	 * 删除该用户的所有角色
	 */
	@Override
	public int deleteUserRoles(Integer userId) {
		
		return cSyuserroleMapper.deleteUserRoles(userId);
	}
	
}
